package com.learn.lock.sync;

/**
 * @author : Yu.Tan
 * @date : 2023/5/8 15:23
 * @desc : **
 */
public class SynchronizedDemo1 {

    public static void main(String[] args) {
        method1();
    }

    public static void method1(){
        synchronized (SynchronizedDemo1.class){
            System.out.println("method1");
        }
        method2();
    }

    public static void method2(){
        System.out.println("method2");

    }
}
